#ifndef MYCOMMANDDATA_H
#define MYCOMMANDDATA_H

#include <QByteArray>


enum MY_COMMAND{
    CMD_UNUSED, CMD_HELLO, CMD_IDENTIFY_USER
};


enum MY_COMMAND_STATUS {
    SERIAL_SENDING, SERIAL_RECVING, SERIAL_OK, SERIAL_TIMEOUT, SERIAL_FAIL
};
enum ACK_TYPE {
    SERIAL_NO_ACK, SERIAL_ACK_REQUIRED
};

enum SERIAL_MODE {
    SERIAL_MODE_SYNCHRONOUS=1, SERIAL_MODE_ASYNCHRONOUS=2
};


class MyCommand{
public:
    MyCommand(){
        cmd = CMD_UNUSED;
        timeout = 0;
        ack = SERIAL_NO_ACK;
        status = SERIAL_SENDING;
        mode = SERIAL_MODE_ASYNCHRONOUS;
    };
    int cmd;
    int timeout;
    char ack;
    char status;
    char mode;
    QByteArray data;
};

class MyCommandGenerator
{
public:
    MyCommandGenerator();

    static int hello(MyCommand&);
    static int identifyUser(MyCommand&);
    static int canfdToggle();
    static int peakdata(MyCommand&, int size, int gbytefactor);
    static int pointdata(MyCommand&, int size, int);
    static int debugdata(MyCommand&, int size, int);
};

#endif // MYCOMMANDDATA_H
